package com.ibeeking.gmc.global.g.rest.controller.v1.feign;

import com.ibeeking.gmc.global.g.rest.service.IOpenConfigService;
import com.ibeeking.found.common.entity.open.OpenConfigDTO;
import com.ibeeking.found.common.entity.open.OpenConfigQuery;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName OpenConfigFeignController
 * @Description 授权客户端
 * @Author ibeeking
 * @Date 2021-05-18 10:34
 **/
@RestController
@RequestMapping("/g/open/feign/v1")
public class OpenConfigFeignController {

    @Resource
    private IOpenConfigService openConfigServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询第三方平台公众号配置信息")
    @PostMapping("/queryOpenConfigOne")
    public OpenConfigDTO queryOpenConfig(@RequestBody OpenConfigQuery query) {
        return openConfigServiceImpl.queryOpenConfigOne(query);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询有效的微信第三方平台配置信息")
    @PostMapping("/queryOpenConfigList")
    public List<OpenConfigDTO> queryOpenConfigList(@RequestBody OpenConfigQuery query) {
        return openConfigServiceImpl.queryOpenConfigList(query);
    }

}
